import paramiko
# 封装transport
transport = paramiko.Transport(('192.168.171.128', 22))
transport.connect(username='root', password='houzheng')
# 设置
ssh = paramiko.SSHClient()
ssh._transport = transport
stdin, stdout, stderr = ssh.exec_command('df')
print(stdout.read().decode())  # 格式化返回结果
transport.close()
